xen: arm: propagate gic's #address-cells property to dom0.
authorIan Campbell <ian.campbell@citrix.com>
Fri, 24 Oct 2014 09:58:33 +0000 (10:58 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 5 Nov 2014 10:11:13 +0000 (10:11 +0000)
The interrupt-map property requires that the interrupt-parent node
must have both #address-cells and #interrupt-cells properties (see
ePAPR 2.4.3.1). Therefore propagate the property if it is present.

We must propagate (rather than invent our own value) since this value
is used to size fields within other properties within the tree.

ePAPR strictly speaking requires that the interrupt-parent node
always has these properties. However reality has diverged from this
and implementations will recursively search parents for #*-cells
properties. Hence we only copy if it is present.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
xen/arch/arm/domain_build.c

index 5aca925a203be4acb49b53e0f9198e2ce39001e6..de180d88fb9863fb56608edf477778ed594d8796 100644 (file)
@@ -788,6 +788,8 @@ static int make_gic_node(const struct domain *d, void *fdt,
 {
     const struct dt_device_node *gic = dt_interrupt_controller;
     int res = 0;
+    const void *addrcells;
+    u32 addrcells_len;
 
     /*
      * Xen currently supports only a single GIC. Discard any secondary
@@ -817,6 +819,14 @@ static int make_gic_node(const struct domain *d, void *fdt,
             return res;
     }
 
+    addrcells = dt_get_property(gic, "#address-cells", &addrcells_len);
+    if ( addrcells )
+    {
+        res = fdt_property(fdt, "#address-cells", addrcells, addrcells_len);
+        if ( res )
+            return res;
+    }
+
     res = fdt_end_node(fdt);
 
     return res;